import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import { resolve } from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    uni(),
  ],
  build:{
    outDir: "dist",
    sourcemap: true, //是否构建source map 文件
    minify: 'terser', //压缩
    terserOptions: {
      // 生产环境移除console
      compress: {
        drop_console: false,
        drop_debugger: false,
      },
    },
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src') // 配置别名
    },
    extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json']
  }
})
